﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;
using DevExpress.Xpf.Core;

namespace sLightLibrary.BasicApp.Views.Forms.User
{
    public partial class BasicPage : Page
    {
        public BasicPage()
        {
            InitializeComponent();
            
        }

        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
           
        }

        private void chkNavibar_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e)
        {
            DevExpress.Xpf.Docking.LayoutGroup m_groupContent = (DevExpress.Xpf.Docking.LayoutGroup)dockLayoutManager1.LayoutRoot.Items["groupContent"];
            if (m_groupContent == null)
                return;
            DevExpress.Xpf.Docking.LayoutPanel m_panelInfo = (DevExpress.Xpf.Docking.LayoutPanel)m_groupContent.Items["panelInfo"];
            if (m_panelInfo != null)
            {
                if (m_panelInfo.IsVisible)
                    m_panelInfo.Visibility = Visibility.Collapsed;
                else
                    m_panelInfo.Visibility = Visibility.Visible;
            }
        }
        private void chkLayout_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e)
        {
            DevExpress.Xpf.Docking.LayoutGroup m_groupContent = (DevExpress.Xpf.Docking.LayoutGroup)dockLayoutManager1.LayoutRoot.Items["groupContent"];
            if (m_groupContent == null)
                return;
            DevExpress.Xpf.Docking.LayoutPanel m_panelLayout = (DevExpress.Xpf.Docking.LayoutPanel)m_groupContent.Items["panelLayout"];
            if (m_panelLayout != null)
            {
                if (m_panelLayout.IsVisible)
                    m_panelLayout.Visibility = Visibility.Collapsed;
                else
                    m_panelLayout.Visibility = Visibility.Visible;
            }
        }
        private void tbrSaveTemp_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e)
        {
            SaveTemplateDialog dlgSaveTemplate = new SaveTemplateDialog();
            dlgSaveTemplate.Show();
        }

        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
           /* myMenuBar1.chkNavibar.ItemClick += new DevExpress.Xpf.Bars.ItemClickEventHandler(chkNavibar_ItemClick);
            myMenuBar1.chkLayout.ItemClick += new DevExpress.Xpf.Bars.ItemClickEventHandler(chkLayout_ItemClick);
            myMenuBar1.tbrSaveTemp.ItemClick += new DevExpress.Xpf.Bars.ItemClickEventHandler(tbrSaveTemp_ItemClick);*/
        }

    }
}
